toptica64=EquipmentControl.ExecutionEquipment.ECDL.Toptica('toptica64');
%%
toptica64.disableScan();

volt = 30:2:70;
trans=zeros(size(volt));
stdTrans=zeros(size(volt));
spect=[]; wp = [];
for k = 1:length(volt)
    toptica64.setScanOffsetVolt( volt(k) );
    val = getAuxIn(zi3543, 10);
    trans(k) = mean(val); 
    stdTrans(k) = std(val);
    wp = [wp gyro.rpm.GET_WorkingPoint];
    spect = [spect gyro.rpm.GET_StdCalibrationSpectrum('average',1600, 'uBound', 300e-6)];
end
toptica64.setScanOffsetVolt(54)

varPumpResultAverage1600.spect=spect;
varPumpResultAverage1600.wp=wp;
varPumpResultAverage1600.trans=trans;
varPumpResultAverage1600.stdTrans=stdTrans;
varPumpResultAverage1600.volt=volt;
session.addMeasurementData('varPumpWavelengthAverage1600', varPumpResultAverage1600);

plot(volt, trans, 'bo-');

function val = getAuxIn(zi, npt)
    val=zeros(1, npt);
    for k=1:10
        val(k) = zi.getAuxInValue('0');pause(0.3);
    end    
end